opt subtitle "HI-TECH Software Omniscient Code Generator (Lite mode) build 10920"

opt pagewidth 120

	opt lm

	processor	16F887
clrc	macro
	bcf	3,0
	endm
clrz	macro
	bcf	3,2
	endm
setc	macro
	bsf	3,0
	endm
setz	macro
	bsf	3,2
	endm
skipc	macro
	btfss	3,0
	endm
skipz	macro
	btfss	3,2
	endm
skipnc	macro
	btfsc	3,0
	endm
skipnz	macro
	btfsc	3,2
	endm
indf	equ	0
indf0	equ	0
pc	equ	2
pcl	equ	2
status	equ	3
fsr	equ	4
fsr0	equ	4
c	equ	1
z	equ	0
pclath	equ	10
# 4 "C:\Users\Admin\Desktop\Project\trunk\Firmware\PIC\main.c"
	psect config,class=CONFIG,delta=2 ;#
# 4 "C:\Users\Admin\Desktop\Project\trunk\Firmware\PIC\main.c"
	dw 0xFFFA & 0xFFF7 & 0xFFEF & 0xFFFF & 0xFFFF & 0xFCFF & 0xFBFF & 0xF7FF & 0xEFFF & 0xFFFF ;#
# 5 "C:\Users\Admin\Desktop\Project\trunk\Firmware\PIC\main.c"
	psect config,class=CONFIG,delta=2 ;#
# 5 "C:\Users\Admin\Desktop\Project\trunk\Firmware\PIC\main.c"
	dw 0xFEFF ;#
	FNCALL	_main,_i2c_init
	FNCALL	_main,_write_time
	FNCALL	_main,_read_time
	FNCALL	_read_time,_i2c_start
	FNCALL	_read_time,_i2c_write
	FNCALL	_read_time,_i2c_stop
	FNCALL	_read_time,_i2c_read
	FNCALL	_write_time,_i2c_start
	FNCALL	_write_time,_i2c_write
	FNCALL	_write_time,_i2c_stop
	FNROOT	_main
	global	_set_time
psect	idataBANK0,class=CODE,space=0,delta=2
global __pidataBANK0
__pidataBANK0:
	file	"C:\Users\Admin\Desktop\Project\trunk\Firmware\PIC\main.c"
	line	10

;initializer for _set_time
	retlw	0
	retlw	030h
	retlw	018h
	retlw	02h
	retlw	04h
	retlw	06h
	retlw	012h
	global	_disp
	global	_time
	global	_PORTB
_PORTB	set	6
	global	_RCREG
_RCREG	set	26
	global	_SSPBUF
_SSPBUF	set	19
	global	_SSPCON
_SSPCON	set	20
	global	_TXREG
_TXREG	set	25
	global	_ADCS0
_ADCS0	set	254
	global	_ADCS1
_ADCS1	set	255
	global	_ADIF
_ADIF	set	102
	global	_ADON
_ADON	set	248
	global	_CARRY
_CARRY	set	24
	global	_CHS0
_CHS0	set	250
	global	_CHS1
_CHS1	set	251
	global	_CHS2
_CHS2	set	252
	global	_CHS3
_CHS3	set	253
	global	_CREN
_CREN	set	196
	global	_GIE
_GIE	set	95
	global	_PEIE
_PEIE	set	94
	global	_RA5
_RA5	set	45
	global	_RC3
_RC3	set	59
	global	_RC4
_RC4	set	60
	global	_RCIF
_RCIF	set	101
	global	_RE0
_RE0	set	72
	global	_RE1
_RE1	set	73
	global	_RE2
_RE2	set	74
	global	_RX9
_RX9	set	198
	global	_SPEN
_SPEN	set	199
	global	_SREN
_SREN	set	197
	global	_SSPIF
_SSPIF	set	99
	global	_TXIF
_TXIF	set	100
	global	_WCOL
_WCOL	set	167
	global	_SPBRG
_SPBRG	set	153
	global	_SSPADD
_SSPADD	set	147
	global	_SSPCON2
_SSPCON2	set	145
	global	_TRISB
_TRISB	set	134
	global	_ACKDT
_ACKDT	set	1165
	global	_ACKEN
_ACKEN	set	1164
	global	_ACKSTAT
_ACKSTAT	set	1166
	global	_ADFM
_ADFM	set	1279
	global	_ADIE
_ADIE	set	1126
	global	_BRGH
_BRGH	set	1218
	global	_PEN
_PEN	set	1162
	global	_RCEN
_RCEN	set	1163
	global	_RCIE
_RCIE	set	1125
	global	_SEN
_SEN	set	1160
	global	_SMP
_SMP	set	1191
	global	_SYNC
_SYNC	set	1220
	global	_TRISA5
_TRISA5	set	1069
	global	_TRISC3
_TRISC3	set	1083
	global	_TRISC4
_TRISC4	set	1084
	global	_TRISC6
_TRISC6	set	1086
	global	_TRISC7
_TRISC7	set	1087
	global	_TRISE0
_TRISE0	set	1096
	global	_TRISE1
_TRISE1	set	1097
	global	_TRISE2
_TRISE2	set	1098
	global	_TX9
_TX9	set	1222
	global	_TXEN
_TXEN	set	1221
	global	_TXIE
_TXIE	set	1124
	global	_VCFG0
_VCFG0	set	1276
	global	_VCFG1
_VCFG1	set	1277
	global	_EEADR
_EEADR	set	269
	global	_EEDATA
_EEDATA	set	268
	global	_ANSEL
_ANSEL	set	392
	global	_ANSELH
_ANSELH	set	393
	global	_EECON1
_EECON1	set	396
	global	_EECON2
_EECON2	set	397
	global	_RD
_RD	set	3168
	global	_WR
_WR	set	3169
	global	_WREN
_WREN	set	3170
	file	"project.as"
	line	#
psect cinit,class=CODE,delta=2
global start_initialization
start_initialization:

psect	bssCOMMON,class=COMMON,space=1
global __pbssCOMMON
__pbssCOMMON:
_time:
       ds      7

psect	bssBANK0,class=BANK0,space=1
global __pbssBANK0
__pbssBANK0:
_disp:
       ds      16

psect	dataBANK0,class=BANK0,space=1
global __pdataBANK0
__pdataBANK0:
	file	"C:\Users\Admin\Desktop\Project\trunk\Firmware\PIC\main.c"
_set_time:
       ds      7

psect clrtext,class=CODE,delta=2
global clear_ram
;	Called with FSR containing the base address, and
;	W with the last address+1
clear_ram:
	clrwdt			;clear the watchdog before getting into this loop
clrloop:
	clrf	indf		;clear RAM location pointed to by FSR
	incf	fsr,f		;increment pointer
	xorwf	fsr,w		;XOR with final address
	btfsc	status,2	;have we reached the end yet?
	retlw	0		;all done for this memory range, return
	xorwf	fsr,w		;XOR again to restore value
	goto	clrloop		;do the next byte

; Clear objects allocated to COMMON
psect cinit,class=CODE,delta=2
	clrf	((__pbssCOMMON)+0)&07Fh
	clrf	((__pbssCOMMON)+1)&07Fh
	clrf	((__pbssCOMMON)+2)&07Fh
	clrf	((__pbssCOMMON)+3)&07Fh
	clrf	((__pbssCOMMON)+4)&07Fh
	clrf	((__pbssCOMMON)+5)&07Fh
	clrf	((__pbssCOMMON)+6)&07Fh
; Clear objects allocated to BANK0
psect cinit,class=CODE,delta=2
	bcf	status, 7	;select IRP bank0
	movlw	low(__pbssBANK0)
	movwf	fsr
	movlw	low((__pbssBANK0)+010h)
	fcall	clear_ram
global btemp
psect inittext,class=CODE,delta=2
global init_fetch,btemp
;	Called with low address in FSR and high address in W
init_fetch:
	movf btemp,w
	movwf pclath
	movf btemp+1,w
	movwf pc
global init_ram
;Called with:
;	high address of idata address in btemp 
;	low address of idata address in btemp+1 
;	low address of data in FSR
;	high address + 1 of data in btemp-1
init_ram:
	fcall init_fetch
	movwf indf,f
	incf fsr,f
	movf fsr,w
	xorwf btemp-1,w
	btfsc status,2
	retlw 0
	incf btemp+1,f
	btfsc status,2
	incf btemp,f
	goto init_ram
; Initialize objects allocated to BANK0
psect cinit,class=CODE,delta=2
global init_ram, __pidataBANK0
	movlw low(__pdataBANK0+7)
	movwf btemp-1,f
	movlw high(__pidataBANK0)
	movwf btemp,f
	movlw low(__pidataBANK0)
	movwf btemp+1,f
	movlw low(__pdataBANK0)
	movwf fsr,f
	fcall init_ram
psect cinit,class=CODE,delta=2
global end_of_initialization

;End of C runtime variable initialization code

end_of_initialization:
clrf status
ljmp _main	;jump to C main() function
psect	cstackCOMMON,class=COMMON,space=1
global __pcstackCOMMON
__pcstackCOMMON:
	global	?_i2c_start
?_i2c_start:	; 0 bytes @ 0x0
	global	??_i2c_start
??_i2c_start:	; 0 bytes @ 0x0
	global	?_i2c_stop
?_i2c_stop:	; 0 bytes @ 0x0
	global	??_i2c_stop
??_i2c_stop:	; 0 bytes @ 0x0
	global	??_i2c_read
??_i2c_read:	; 0 bytes @ 0x0
	global	??_i2c_write
??_i2c_write:	; 0 bytes @ 0x0
	global	?_i2c_init
?_i2c_init:	; 0 bytes @ 0x0
	global	??_i2c_init
??_i2c_init:	; 0 bytes @ 0x0
	global	?_write_time
?_write_time:	; 0 bytes @ 0x0
	global	?_read_time
?_read_time:	; 0 bytes @ 0x0
	global	?_main
?_main:	; 0 bytes @ 0x0
	global	?_i2c_read
?_i2c_read:	; 1 bytes @ 0x0
	global	?_i2c_write
?_i2c_write:	; 1 bytes @ 0x0
	global	i2c_read@ack
i2c_read@ack:	; 1 bytes @ 0x0
	global	i2c_write@d
i2c_write@d:	; 1 bytes @ 0x0
	ds	1
	global	??_write_time
??_write_time:	; 0 bytes @ 0x1
	global	??_read_time
??_read_time:	; 0 bytes @ 0x1
	ds	1
	global	write_time@i
write_time@i:	; 1 bytes @ 0x2
	global	read_time@i
read_time@i:	; 1 bytes @ 0x2
	ds	1
	global	??_main
??_main:	; 0 bytes @ 0x3
	ds	2
	global	main@tam
main@tam:	; 1 bytes @ 0x5
	ds	1
;;Data sizes: Strings 0, constant 0, data 7, bss 23, persistent 0 stack 0
;;Auto spaces:   Size  Autos    Used
;; COMMON          14      6      13
;; BANK0           80      0      23
;; BANK1           80      0       0
;; BANK3           96      0       0
;; BANK2           96      0       0

;;
;; Pointer list with targets:



;;
;; Critical Paths under _main in COMMON
;;
;;   _main->_write_time
;;   _main->_read_time
;;   _read_time->_i2c_write
;;   _read_time->_i2c_read
;;   _write_time->_i2c_write
;;
;; Critical Paths under _main in BANK0
;;
;;   None.
;;
;; Critical Paths under _main in BANK1
;;
;;   None.
;;
;; Critical Paths under _main in BANK3
;;
;;   None.
;;
;; Critical Paths under _main in BANK2
;;
;;   None.

;;
;;Main: autosize = 0, tempsize = 2, incstack = 0, save=0
;;

;;
;;Call Graph Tables:
;;
;; ---------------------------------------------------------------------------------
;; (Depth) Function   	        Calls       Base Space   Used Autos Params    Refs
;; ---------------------------------------------------------------------------------
;; (0) _main                                                 5     5      0     219
;;                                              3 COMMON     3     3      0
;;                           _i2c_init
;;                         _write_time
;;                          _read_time
;; ---------------------------------------------------------------------------------
;; (1) _read_time                                            2     2      0     105
;;                                              1 COMMON     2     2      0
;;                          _i2c_start
;;                          _i2c_write
;;                           _i2c_stop
;;                           _i2c_read
;; ---------------------------------------------------------------------------------
;; (1) _write_time                                           2     2      0      90
;;                                              1 COMMON     2     2      0
;;                          _i2c_start
;;                          _i2c_write
;;                           _i2c_stop
;; ---------------------------------------------------------------------------------
;; (1) _i2c_init                                             0     0      0       0
;; ---------------------------------------------------------------------------------
;; (2) _i2c_write                                            1     1      0      22
;;                                              0 COMMON     1     1      0
;; ---------------------------------------------------------------------------------
;; (2) _i2c_read                                             1     1      0      15
;;                                              0 COMMON     1     1      0
;; ---------------------------------------------------------------------------------
;; (2) _i2c_stop                                             0     0      0       0
;; ---------------------------------------------------------------------------------
;; (2) _i2c_start                                            0     0      0       0
;; ---------------------------------------------------------------------------------
;; Estimated maximum stack depth 2
;; ---------------------------------------------------------------------------------

;; Call Graph Graphs:

;; _main (ROOT)
;;   _i2c_init
;;   _write_time
;;     _i2c_start
;;     _i2c_write
;;     _i2c_stop
;;   _read_time
;;     _i2c_start
;;     _i2c_write
;;     _i2c_stop
;;     _i2c_read
;;

;; Address spaces:

;;Name               Size   Autos  Total    Cost      Usage
;;BANK3               60      0       0       9        0.0%
;;BITBANK3            60      0       0       8        0.0%
;;SFR3                 0      0       0       4        0.0%
;;BITSFR3              0      0       0       4        0.0%
;;BANK2               60      0       0      11        0.0%
;;BITBANK2            60      0       0      10        0.0%
;;SFR2                 0      0       0       5        0.0%
;;BITSFR2              0      0       0       5        0.0%
;;SFR1                 0      0       0       2        0.0%
;;BITSFR1              0      0       0       2        0.0%
;;BANK1               50      0       0       7        0.0%
;;BITBANK1            50      0       0       6        0.0%
;;CODE                 0      0       0       0        0.0%
;;DATA                 0      0      26      12        0.0%
;;ABS                  0      0      24       3        0.0%
;;NULL                 0      0       0       0        0.0%
;;STACK                0      0       2       2        0.0%
;;BANK0               50      0      17       5       28.8%
;;BITBANK0            50      0       0       4        0.0%
;;SFR0                 0      0       0       1        0.0%
;;BITSFR0              0      0       0       1        0.0%
;;COMMON               E      6       D       1       92.9%
;;BITCOMMON            E      0       0       0        0.0%
;;EEDATA             100      0       0       0        0.0%

	global	_main
psect	maintext,global,class=CODE,delta=2
global __pmaintext
__pmaintext:

;; *************** function _main *****************
;; Defined at:
;;		line 317 in file "C:\Users\Admin\Desktop\Project\trunk\Firmware\PIC\main.c"
;; Parameters:    Size  Location     Type
;;		None
;; Auto vars:     Size  Location     Type
;;  dem             2    0        int 
;;  tam             1    5[COMMON] unsigned char 
;; Return value:  Size  Location     Type
;;		None               void
;; Registers used:
;;		wreg, fsr0l, fsr0h, status,2, status,0, pclath, cstack
;; Tracked objects:
;;		On entry : 17F/0
;;		On exit  : 0/0
;;		Unchanged: 0/0
;; Data sizes:     COMMON   BANK0   BANK1   BANK3   BANK2
;;      Params:         0       0       0       0       0
;;      Locals:         1       0       0       0       0
;;      Temps:          2       0       0       0       0
;;      Totals:         3       0       0       0       0
;;Total ram usage:        3 bytes
;; Hardware stack levels required when called:    2
;; This function calls:
;;		_i2c_init
;;		_write_time
;;		_read_time
;; This function is called by:
;;		Startup code after reset
;; This function uses a non-reentrant model
;;
psect	maintext
	file	"C:\Users\Admin\Desktop\Project\trunk\Firmware\PIC\main.c"
	line	317
	global	__size_of_main
	__size_of_main	equ	__end_of_main-_main
	
_main:	
	opt	stack 6
; Regs used in _main: [wreg-fsr0h+status,2+status,0+pclath+cstack]
	line	318
	
l7706:	
;main.c: 318: unsigned char tam=0;
	clrf	(main@tam)
	line	320
	
l7708:	
;main.c: 319: int dem;
;main.c: 320: ANSEL=0;
	bsf	status, 5	;RP0=1, select bank3
	bsf	status, 6	;RP1=1, select bank3
	clrf	(392)^0180h	;volatile
	line	321
;main.c: 321: ANSELH=0;
	clrf	(393)^0180h	;volatile
	line	322
	
l7710:	
;main.c: 322: PORTB=0xff;
	movlw	(0FFh)
	bcf	status, 5	;RP0=0, select bank0
	bcf	status, 6	;RP1=0, select bank0
	movwf	(6)	;volatile
	line	323
	
l7712:	
;main.c: 323: TRISB=0xff;
	movlw	(0FFh)
	bsf	status, 5	;RP0=1, select bank1
	bcf	status, 6	;RP1=0, select bank1
	movwf	(134)^080h	;volatile
	line	324
	
l7714:	
;main.c: 324: TRISE0=0;
	bcf	(1096/8)^080h,(1096)&7
	line	325
	
l7716:	
;main.c: 325: RE0=1;
	bcf	status, 5	;RP0=0, select bank0
	bcf	status, 6	;RP1=0, select bank0
	bsf	(72/8),(72)&7
	line	326
	
l7718:	
;main.c: 326: i2c_init();
	fcall	_i2c_init
	line	328
	
l7720:	
;main.c: 328: _delay((unsigned long)((10)*(4000000/4000.0)));
	opt asmopt_off
movlw	13
movwf	((??_main+0)+0+1),f
	movlw	251
movwf	((??_main+0)+0),f
u2567:
	decfsz	((??_main+0)+0),f
	goto	u2567
	decfsz	((??_main+0)+0+1),f
	goto	u2567
	nop2
opt asmopt_on

	line	329
	
l7722:	
;main.c: 329: disp[11]=2;
	movlw	(02h)
	movwf	(??_main+0)+0
	movf	(??_main+0)+0,w
	bcf	status, 5	;RP0=0, select bank0
	bcf	status, 6	;RP1=0, select bank0
	movwf	0+(_disp)+0Bh
	line	330
	
l7724:	
;main.c: 330: disp[12]=0;
	clrf	0+(_disp)+0Ch
	line	331
	
l7726:	
;main.c: 331: write_time();
	fcall	_write_time
	goto	l7728
	line	332
;main.c: 332: while(1)
	
l5227:	
	line	335
	
l7728:	
;main.c: 333: {
;main.c: 335: read_time();
	fcall	_read_time
	line	337
	
l7730:	
;main.c: 337: if(tam!=time[0])
	movf	(_time),w
	xorwf	(main@tam),w
	skipnz
	goto	u2551
	goto	u2550
u2551:
	goto	l7728
u2550:
	line	339
	
l7732:	
;main.c: 338: {
;main.c: 339: RE0^=1;
	bcf	status, 5	;RP0=0, select bank0
	bcf	status, 6	;RP1=0, select bank0
	movlw	1<<((72)&7)
	xorwf	((72)/8),f
	line	340
;main.c: 340: tam=time[0];
	movf	(_time),w
	movwf	(??_main+0)+0
	movf	(??_main+0)+0,w
	movwf	(main@tam)
	goto	l7728
	line	343
	
l5228:	
	goto	l7728
	line	355
	
l5229:	
	line	332
	goto	l7728
	
l5230:	
	line	357
	
l5231:	
	global	start
	ljmp	start
	opt stack 0
GLOBAL	__end_of_main
	__end_of_main:
;; =============== function _main ends ============

	signat	_main,88
	global	_read_time
psect	text239,local,class=CODE,delta=2
global __ptext239
__ptext239:

;; *************** function _read_time *****************
;; Defined at:
;;		line 25 in file "C:\Users\Admin\Desktop\Project\trunk\Firmware\PIC\main.c"
;; Parameters:    Size  Location     Type
;;		None
;; Auto vars:     Size  Location     Type
;;  i               1    2[COMMON] unsigned char 
;; Return value:  Size  Location     Type
;;		None               void
;; Registers used:
;;		wreg, fsr0l, fsr0h, status,2, status,0, pclath, cstack
;; Tracked objects:
;;		On entry : 0/0
;;		On exit  : 0/0
;;		Unchanged: 0/0
;; Data sizes:     COMMON   BANK0   BANK1   BANK3   BANK2
;;      Params:         0       0       0       0       0
;;      Locals:         1       0       0       0       0
;;      Temps:          1       0       0       0       0
;;      Totals:         2       0       0       0       0
;;Total ram usage:        2 bytes
;; Hardware stack levels used:    1
;; Hardware stack levels required when called:    1
;; This function calls:
;;		_i2c_start
;;		_i2c_write
;;		_i2c_stop
;;		_i2c_read
;; This function is called by:
;;		_main
;; This function uses a non-reentrant model
;;
psect	text239
	file	"C:\Users\Admin\Desktop\Project\trunk\Firmware\PIC\main.c"
	line	25
	global	__size_of_read_time
	__size_of_read_time	equ	__end_of_read_time-_read_time
	
_read_time:	
	opt	stack 6
; Regs used in _read_time: [wreg-fsr0h+status,2+status,0+pclath+cstack]
	line	27
	
l7684:	
;main.c: 26: unsigned char i;
;main.c: 27: i2c_start();
	fcall	_i2c_start
	line	28
	
l7686:	
;main.c: 28: i2c_write(0xd0);
	movlw	(0D0h)
	fcall	_i2c_write
	line	29
	
l7688:	
;main.c: 29: i2c_write(0x00);
	movlw	(0)
	fcall	_i2c_write
	line	30
;main.c: 30: i2c_stop();
	fcall	_i2c_stop
	line	31
;main.c: 31: i2c_start();
	fcall	_i2c_start
	line	32
	
l7690:	
;main.c: 32: i2c_write(0xd1);
	movlw	(0D1h)
	fcall	_i2c_write
	line	33
	
l7692:	
;main.c: 33: for(i=0;i<6;i++)
	clrf	(read_time@i)
	movlw	(06h)
	subwf	(read_time@i),w
	skipc
	goto	u2531
	goto	u2530
u2531:
	goto	l7696
u2530:
	goto	l7702
	
l7694:	
	goto	l7702
	line	34
	
l5222:	
	
l7696:	
;main.c: 34: time[i]=i2c_read(0);
	movlw	(0)
	fcall	_i2c_read
	movwf	(??_read_time+0)+0
	movf	(read_time@i),w
	addlw	_time&0ffh
	movwf	fsr0
	movf	(??_read_time+0)+0,w
	movwf	indf
	line	33
	
l7698:	
	movlw	(01h)
	movwf	(??_read_time+0)+0
	movf	(??_read_time+0)+0,w
	addwf	(read_time@i),f
	
l7700:	
	movlw	(06h)
	subwf	(read_time@i),w
	skipc
	goto	u2541
	goto	u2540
u2541:
	goto	l7696
u2540:
	goto	l7702
	
l5223:	
	line	35
	
l7702:	
;main.c: 35: time[6]=i2c_read(1);
	movlw	(01h)
	fcall	_i2c_read
	movwf	(??_read_time+0)+0
	movf	(??_read_time+0)+0,w
	movwf	0+(_time)+06h
	line	36
	
l7704:	
;main.c: 36: i2c_stop();
	fcall	_i2c_stop
	line	37
	
l5224:	
	return
	opt stack 0
GLOBAL	__end_of_read_time
	__end_of_read_time:
;; =============== function _read_time ends ============

	signat	_read_time,88
	global	_write_time
psect	text240,local,class=CODE,delta=2
global __ptext240
__ptext240:

;; *************** function _write_time *****************
;; Defined at:
;;		line 14 in file "C:\Users\Admin\Desktop\Project\trunk\Firmware\PIC\main.c"
;; Parameters:    Size  Location     Type
;;		None
;; Auto vars:     Size  Location     Type
;;  i               1    2[COMMON] unsigned char 
;; Return value:  Size  Location     Type
;;		None               void
;; Registers used:
;;		wreg, fsr0l, fsr0h, status,2, status,0, pclath, cstack
;; Tracked objects:
;;		On entry : 0/0
;;		On exit  : 0/0
;;		Unchanged: 0/0
;; Data sizes:     COMMON   BANK0   BANK1   BANK3   BANK2
;;      Params:         0       0       0       0       0
;;      Locals:         1       0       0       0       0
;;      Temps:          1       0       0       0       0
;;      Totals:         2       0       0       0       0
;;Total ram usage:        2 bytes
;; Hardware stack levels used:    1
;; Hardware stack levels required when called:    1
;; This function calls:
;;		_i2c_start
;;		_i2c_write
;;		_i2c_stop
;; This function is called by:
;;		_main
;; This function uses a non-reentrant model
;;
psect	text240
	file	"C:\Users\Admin\Desktop\Project\trunk\Firmware\PIC\main.c"
	line	14
	global	__size_of_write_time
	__size_of_write_time	equ	__end_of_write_time-_write_time
	
_write_time:	
	opt	stack 6
; Regs used in _write_time: [wreg-fsr0h+status,2+status,0+pclath+cstack]
	line	16
	
l7664:	
;main.c: 15: unsigned char i;
;main.c: 16: i2c_start();
	fcall	_i2c_start
	line	17
	
l7666:	
;main.c: 17: i2c_write(0xd0);
	movlw	(0D0h)
	fcall	_i2c_write
	line	18
	
l7668:	
;main.c: 18: i2c_write(0x00);
	movlw	(0)
	fcall	_i2c_write
	line	19
	
l7670:	
;main.c: 19: for(i=0;i<7;i++)
	clrf	(write_time@i)
	
l7672:	
	movlw	(07h)
	subwf	(write_time@i),w
	skipc
	goto	u2511
	goto	u2510
u2511:
	goto	l7676
u2510:
	goto	l7682
	
l7674:	
	goto	l7682
	line	20
	
l5217:	
	
l7676:	
;main.c: 20: i2c_write(set_time[i]);
	movf	(write_time@i),w
	addlw	_set_time&0ffh
	movwf	fsr0
	bcf	status, 7	;select IRP bank0
	movf	indf,w
	fcall	_i2c_write
	line	19
	
l7678:	
	movlw	(01h)
	movwf	(??_write_time+0)+0
	movf	(??_write_time+0)+0,w
	addwf	(write_time@i),f
	
l7680:	
	movlw	(07h)
	subwf	(write_time@i),w
	skipc
	goto	u2521
	goto	u2520
u2521:
	goto	l7676
u2520:
	goto	l7682
	
l5218:	
	line	21
	
l7682:	
;main.c: 21: i2c_stop();
	fcall	_i2c_stop
	line	22
	
l5219:	
	return
	opt stack 0
GLOBAL	__end_of_write_time
	__end_of_write_time:
;; =============== function _write_time ends ============

	signat	_write_time,88
	global	_i2c_init
psect	text241,local,class=CODE,delta=2
global __ptext241
__ptext241:

;; *************** function _i2c_init *****************
;; Defined at:
;;		line 35 in file "C:\Users\Admin\Desktop\Project\trunk\Firmware\PIC\i2c.c"
;; Parameters:    Size  Location     Type
;;		None
;; Auto vars:     Size  Location     Type
;;		None
;; Return value:  Size  Location     Type
;;		None               void
;; Registers used:
;;		wreg, status,2
;; Tracked objects:
;;		On entry : 0/0
;;		On exit  : 0/0
;;		Unchanged: 0/0
;; Data sizes:     COMMON   BANK0   BANK1   BANK3   BANK2
;;      Params:         0       0       0       0       0
;;      Locals:         0       0       0       0       0
;;      Temps:          0       0       0       0       0
;;      Totals:         0       0       0       0       0
;;Total ram usage:        0 bytes
;; Hardware stack levels used:    1
;; This function calls:
;;		Nothing
;; This function is called by:
;;		_main
;; This function uses a non-reentrant model
;;
psect	text241
	file	"C:\Users\Admin\Desktop\Project\trunk\Firmware\PIC\i2c.c"
	line	35
	global	__size_of_i2c_init
	__size_of_i2c_init	equ	__end_of_i2c_init-_i2c_init
	
_i2c_init:	
	opt	stack 7
; Regs used in _i2c_init: [wreg+status,2]
	line	37
	
l6618:	
;i2c.c: 37: RC3 = 1;
	bcf	status, 5	;RP0=0, select bank0
	bcf	status, 6	;RP1=0, select bank0
	bsf	(59/8),(59)&7
	line	38
;i2c.c: 38: RC4 = 1;
	bsf	(60/8),(60)&7
	line	39
;i2c.c: 39: TRISC3 = 1;
	bsf	status, 5	;RP0=1, select bank1
	bcf	status, 6	;RP1=0, select bank1
	bsf	(1083/8)^080h,(1083)&7
	line	40
;i2c.c: 40: TRISC4 = 1;
	bsf	(1084/8)^080h,(1084)&7
	line	42
	
l6620:	
;i2c.c: 42: SSPADD = 9;
	movlw	(09h)
	movwf	(147)^080h	;volatile
	line	43
	
l6622:	
;i2c.c: 43: SMP = 1;
	bsf	(1191/8)^080h,(1191)&7
	line	44
	
l6624:	
;i2c.c: 44: SSPCON2 = 0;
	clrf	(145)^080h	;volatile
	line	45
	
l6626:	
;i2c.c: 45: SSPCON = 0x28;
	movlw	(028h)
	bcf	status, 5	;RP0=0, select bank0
	bcf	status, 6	;RP1=0, select bank0
	movwf	(20)	;volatile
	line	46
	
l2085:	
	return
	opt stack 0
GLOBAL	__end_of_i2c_init
	__end_of_i2c_init:
;; =============== function _i2c_init ends ============

	signat	_i2c_init,88
	global	_i2c_write
psect	text242,local,class=CODE,delta=2
global __ptext242
__ptext242:

;; *************** function _i2c_write *****************
;; Defined at:
;;		line 20 in file "C:\Users\Admin\Desktop\Project\trunk\Firmware\PIC\i2c.c"
;; Parameters:    Size  Location     Type
;;  d               1    wreg     unsigned char 
;; Auto vars:     Size  Location     Type
;;  d               1    0[COMMON] unsigned char 
;; Return value:  Size  Location     Type
;;                  1    wreg      unsigned char 
;; Registers used:
;;		wreg
;; Tracked objects:
;;		On entry : 0/0
;;		On exit  : 0/0
;;		Unchanged: 0/0
;; Data sizes:     COMMON   BANK0   BANK1   BANK3   BANK2
;;      Params:         0       0       0       0       0
;;      Locals:         1       0       0       0       0
;;      Temps:          0       0       0       0       0
;;      Totals:         1       0       0       0       0
;;Total ram usage:        1 bytes
;; Hardware stack levels used:    1
;; This function calls:
;;		Nothing
;; This function is called by:
;;		_write_time
;;		_read_time
;; This function uses a non-reentrant model
;;
psect	text242
	file	"C:\Users\Admin\Desktop\Project\trunk\Firmware\PIC\i2c.c"
	line	20
	global	__size_of_i2c_write
	__size_of_i2c_write	equ	__end_of_i2c_write-_i2c_write
	
_i2c_write:	
	opt	stack 6
; Regs used in _i2c_write: [wreg]
;i2c_write@d stored from wreg
	movwf	(i2c_write@d)
	line	21
	
l7646:	
;i2c.c: 21: WCOL = 0;
	bcf	status, 5	;RP0=0, select bank0
	bcf	status, 6	;RP1=0, select bank0
	bcf	(167/8),(167)&7
	line	22
;i2c.c: 22: SSPIF = 0;
	bcf	(99/8),(99)&7
	line	23
	
l7648:	
;i2c.c: 23: SSPBUF = d;
	movf	(i2c_write@d),w
	movwf	(19)	;volatile
	line	24
	
l7650:	
# 24 "C:\Users\Admin\Desktop\Project\trunk\Firmware\PIC\i2c.c"
nop ;#
psect	text242
	line	25
	
l7652:	
# 25 "C:\Users\Admin\Desktop\Project\trunk\Firmware\PIC\i2c.c"
nop ;#
psect	text242
	line	26
	
l7654:	
# 26 "C:\Users\Admin\Desktop\Project\trunk\Firmware\PIC\i2c.c"
nop ;#
psect	text242
	line	27
	
l7656:	
;i2c.c: 27: if(WCOL) return 2;
	bcf	status, 5	;RP0=0, select bank0
	bcf	status, 6	;RP1=0, select bank0
	btfss	(167/8),(167)&7
	goto	u2491
	goto	u2490
u2491:
	goto	l2079
u2490:
	goto	l2077
	
l7658:	
;	Return value of _i2c_write is never used
	goto	l2077
	
l7660:	
	goto	l2077
	line	28
	
l2076:	
	line	29
;i2c.c: 28: else {
;i2c.c: 29: while(!SSPIF);
	goto	l2079
	
l2080:	
	
l2079:	
	btfss	(99/8),(99)&7
	goto	u2501
	goto	u2500
u2501:
	goto	l2079
u2500:
	
l2081:	
	line	30
;i2c.c: 30: if(ACKSTAT) return 1;
	goto	l2077
	
l7662:	
;	Return value of _i2c_write is never used
	goto	l2077
	
l2082:	
	line	31
;i2c.c: 31: return 0;
;	Return value of _i2c_write is never used
	goto	l2077
	line	32
	
l2078:	
	line	33
	
l2077:	
	return
	opt stack 0
GLOBAL	__end_of_i2c_write
	__end_of_i2c_write:
;; =============== function _i2c_write ends ============

	signat	_i2c_write,4217
	global	_i2c_read
psect	text243,local,class=CODE,delta=2
global __ptext243
__ptext243:

;; *************** function _i2c_read *****************
;; Defined at:
;;		line 12 in file "C:\Users\Admin\Desktop\Project\trunk\Firmware\PIC\i2c.c"
;; Parameters:    Size  Location     Type
;;  ack             1    wreg     unsigned char 
;; Auto vars:     Size  Location     Type
;;  ack             1    0[COMMON] unsigned char 
;; Return value:  Size  Location     Type
;;                  1    wreg      unsigned char 
;; Registers used:
;;		wreg
;; Tracked objects:
;;		On entry : 0/0
;;		On exit  : 0/0
;;		Unchanged: 0/0
;; Data sizes:     COMMON   BANK0   BANK1   BANK3   BANK2
;;      Params:         0       0       0       0       0
;;      Locals:         1       0       0       0       0
;;      Temps:          0       0       0       0       0
;;      Totals:         1       0       0       0       0
;;Total ram usage:        1 bytes
;; Hardware stack levels used:    1
;; This function calls:
;;		Nothing
;; This function is called by:
;;		_read_time
;; This function uses a non-reentrant model
;;
psect	text243
	file	"C:\Users\Admin\Desktop\Project\trunk\Firmware\PIC\i2c.c"
	line	12
	global	__size_of_i2c_read
	__size_of_i2c_read	equ	__end_of_i2c_read-_i2c_read
	
_i2c_read:	
	opt	stack 6
; Regs used in _i2c_read: [wreg]
;i2c_read@ack stored from wreg
	movwf	(i2c_read@ack)
	line	13
	
l6594:	
;i2c.c: 13: RCEN = 1;
	bsf	status, 5	;RP0=1, select bank1
	bcf	status, 6	;RP1=0, select bank1
	bsf	(1163/8)^080h,(1163)&7
	line	14
;i2c.c: 14: while(RCEN);
	goto	l2067
	
l2068:	
	
l2067:	
	btfsc	(1163/8)^080h,(1163)&7
	goto	u31
	goto	u30
u31:
	goto	l2067
u30:
	
l2069:	
	line	15
;i2c.c: 15: ACKDT = ack;
	btfsc	(i2c_read@ack),0
	goto	u41
	goto	u40
	
u41:
	bsf	status, 5	;RP0=1, select bank1
	bcf	status, 6	;RP1=0, select bank1
	bsf	(1165/8)^080h,(1165)&7
	goto	u54
u40:
	bsf	status, 5	;RP0=1, select bank1
	bcf	status, 6	;RP1=0, select bank1
	bcf	(1165/8)^080h,(1165)&7
u54:
	line	16
;i2c.c: 16: ACKEN = 1;
	bsf	(1164/8)^080h,(1164)&7
	line	17
;i2c.c: 17: while(ACKEN);
	goto	l2070
	
l2071:	
	
l2070:	
	btfsc	(1164/8)^080h,(1164)&7
	goto	u61
	goto	u60
u61:
	goto	l2070
u60:
	goto	l6596
	
l2072:	
	line	18
	
l6596:	
;i2c.c: 18: return SSPBUF;
	bcf	status, 5	;RP0=0, select bank0
	bcf	status, 6	;RP1=0, select bank0
	movf	(19),w	;volatile
	goto	l2073
	
l6598:	
	line	19
	
l2073:	
	return
	opt stack 0
GLOBAL	__end_of_i2c_read
	__end_of_i2c_read:
;; =============== function _i2c_read ends ============

	signat	_i2c_read,4217
	global	_i2c_stop
psect	text244,local,class=CODE,delta=2
global __ptext244
__ptext244:

;; *************** function _i2c_stop *****************
;; Defined at:
;;		line 8 in file "C:\Users\Admin\Desktop\Project\trunk\Firmware\PIC\i2c.c"
;; Parameters:    Size  Location     Type
;;		None
;; Auto vars:     Size  Location     Type
;;		None
;; Return value:  Size  Location     Type
;;		None               void
;; Registers used:
;;		None
;; Tracked objects:
;;		On entry : 0/0
;;		On exit  : 0/0
;;		Unchanged: 0/0
;; Data sizes:     COMMON   BANK0   BANK1   BANK3   BANK2
;;      Params:         0       0       0       0       0
;;      Locals:         0       0       0       0       0
;;      Temps:          0       0       0       0       0
;;      Totals:         0       0       0       0       0
;;Total ram usage:        0 bytes
;; Hardware stack levels used:    1
;; This function calls:
;;		Nothing
;; This function is called by:
;;		_write_time
;;		_read_time
;; This function uses a non-reentrant model
;;
psect	text244
	file	"C:\Users\Admin\Desktop\Project\trunk\Firmware\PIC\i2c.c"
	line	8
	global	__size_of_i2c_stop
	__size_of_i2c_stop	equ	__end_of_i2c_stop-_i2c_stop
	
_i2c_stop:	
	opt	stack 6
; Regs used in _i2c_stop: []
	line	9
	
l7644:	
;i2c.c: 9: PEN = 1;
	bsf	status, 5	;RP0=1, select bank1
	bcf	status, 6	;RP1=0, select bank1
	bsf	(1162/8)^080h,(1162)&7
	line	10
;i2c.c: 10: while(PEN);
	goto	l2061
	
l2062:	
	
l2061:	
	btfsc	(1162/8)^080h,(1162)&7
	goto	u2481
	goto	u2480
u2481:
	goto	l2061
u2480:
	goto	l2064
	
l2063:	
	line	11
	
l2064:	
	return
	opt stack 0
GLOBAL	__end_of_i2c_stop
	__end_of_i2c_stop:
;; =============== function _i2c_stop ends ============

	signat	_i2c_stop,88
	global	_i2c_start
psect	text245,local,class=CODE,delta=2
global __ptext245
__ptext245:

;; *************** function _i2c_start *****************
;; Defined at:
;;		line 4 in file "C:\Users\Admin\Desktop\Project\trunk\Firmware\PIC\i2c.c"
;; Parameters:    Size  Location     Type
;;		None
;; Auto vars:     Size  Location     Type
;;		None
;; Return value:  Size  Location     Type
;;		None               void
;; Registers used:
;;		None
;; Tracked objects:
;;		On entry : 0/0
;;		On exit  : 0/0
;;		Unchanged: 0/0
;; Data sizes:     COMMON   BANK0   BANK1   BANK3   BANK2
;;      Params:         0       0       0       0       0
;;      Locals:         0       0       0       0       0
;;      Temps:          0       0       0       0       0
;;      Totals:         0       0       0       0       0
;;Total ram usage:        0 bytes
;; Hardware stack levels used:    1
;; This function calls:
;;		Nothing
;; This function is called by:
;;		_write_time
;;		_read_time
;; This function uses a non-reentrant model
;;
psect	text245
	file	"C:\Users\Admin\Desktop\Project\trunk\Firmware\PIC\i2c.c"
	line	4
	global	__size_of_i2c_start
	__size_of_i2c_start	equ	__end_of_i2c_start-_i2c_start
	
_i2c_start:	
	opt	stack 6
; Regs used in _i2c_start: []
	line	5
	
l7642:	
;i2c.c: 5: SEN = 1;
	bsf	status, 5	;RP0=1, select bank1
	bcf	status, 6	;RP1=0, select bank1
	bsf	(1160/8)^080h,(1160)&7
	line	6
;i2c.c: 6: while(SEN);
	goto	l2055
	
l2056:	
	
l2055:	
	btfsc	(1160/8)^080h,(1160)&7
	goto	u2471
	goto	u2470
u2471:
	goto	l2055
u2470:
	goto	l2058
	
l2057:	
	line	7
	
l2058:	
	return
	opt stack 0
GLOBAL	__end_of_i2c_start
	__end_of_i2c_start:
;; =============== function _i2c_start ends ============

	signat	_i2c_start,88
psect	text246,local,class=CODE,delta=2
global __ptext246
__ptext246:
	global	btemp
	btemp set 07Eh

	DABS	1,126,2	;btemp
	global	wtemp0
	wtemp0 set btemp
	end
